﻿@model RH.Web.ViewModels.ModalViewModel
@using RH.Common.Extensions;
@{
    
}
@if (Model != null) { 
    <div class="modal fade" id="@Model.ControlID" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">@(Model.Caption.IsNullOrEmpty() ? MvcHtmlString.Create("&nbsp;") : MvcHtmlString.Create(Model.Caption))</h4>
                </div>
                <div class="modal-body">
                    @if (!Model.Body.IsNullOrEmpty()) {
                        @Html.Partial(Model.Body, Model.BodyModel)
                    }
                    else { 
                        @MvcHtmlString.Create(Model.BodyHtml)
                    }
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i class="glyphicon glyphicon-off"></i> @Model.CloseButton</button>
                    @if (!Model.SaveAction.IsNullOrEmpty()) {
                        <button type="button" class="btn btn-primary" onclick="@Model.SaveAction;"><i class="glyphicon glyphicon-ok"></i> @Model.SaveButton</button>
                    }
                </div>
            </div>
        </div>
    </div>
}